// 設置永久緩存
export const Local = {
    set(key:string,value:any){
        window.localStorage.setItem(key,JSON.stringify(value));
    },
    get(key:string){
        let json:any = window.localStorage.getItem(key);
        return JSON.parse(json)
    },
    remove(key:string){
        window.localStorage.removeItem(key);
    },
    clear(){
      window.localStorage.clear();
    }
}
export const Session = {
    set(key:string,value:any){
        window.sessionStorage.setItem(key,JSON.stringify(value));
    },
    get(key:string){
        let json:any = window.sessionStorage.getItem(key);
        return JSON.parse(json);
    },
    remove(key:string){},
    clear(){
        window.sessionStorage.clear()
    }
}